import Vue from 'vue'
import VueRouter from 'vue-router'
import Admin from '../views/admin/Admin'
import Index from "../views/index/Index"
import AccountManagement from "../views/accountManagement/AccountManagement";
import CheckedRecord from "../views/checkedRecord/CheckedRecord";
import UncheckedList from "../views/uncheckedList/UncheckedList";
import StatisticManagement from "../views/statisticManagement/StatisticManagement";
import Logout from "../views/logout/Logout";
import RecordDetail from "../views/checkedRecord/childCpn/RecordDetail";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect : '/login'
  },
  {
    path: '/login',
    component: Admin,
  },
  {
    path: '/index',
    component: Index,
    redirect: '/accountManagement',
    children:[
      {
        path: '/accountManagement',
        component: AccountManagement,
        meta:'账号管理'
      },
      {
        path: '/checkedRecord',
        component: CheckedRecord,
        meta:'打卡名单'
      },
      {
        path: '/recordDetail',
        name:'recordDetail',
        component: RecordDetail,
        meta: '记录详情'
      },
      {
        path: '/uncheckedList',
        component: UncheckedList,
        meta: '未打卡名单'
      },
      {
        path: '/statisticManagement',
        component: StatisticManagement,
        meta: '统计管理'
      },
      {
        path: '/logout',
        component: Logout
      }
    ]
  }
]

const router = new VueRouter({
  routes,
  mode:'history'
})

export default router
